@extends('layouts.admin')
@section('content')
<!--Side menu and right menu -->
<!-- main content -->
<section class="content home">
    <div class="container-fluid">
        <div class="block-header">
            <h2>内容管理</h2>
            <ol class="breadcrumb">
                <li><a href="/admin">首页</a></li>
                <li><a href="/admin/article">内容管理</a></li>
                <li class="active">文章管理</li>
            </ol>
        </div>
        @if (Session::has('success'))
        <div class="alert bg-green alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
            <p> {{Session::get('success')}}</p>
        </div>
        @endif
        @if(count($errors)>0)
        <div class="alert bg-green alert-warning alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
            @foreach($errors->all() as $error)
            <p>{{$error}}</p>
            @endforeach
        </div>
        @endif
        <div class="row clearfix">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="card">
                    <div class="header">
                        <h2>文章列表</h2>
                        <ul class="header-dropdown m-r--5">
                            <li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="zmdi zmdi-more-vert"></i></a>
                                <ul class="dropdown-menu pull-right">
                                    <li><a href="{{url('admin/article/create')}}" class=" waves-effect waves-block">新建文章</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    <div class="body">
                        <div class="table-responsive">
                            <div class="comment-box">
                                <div class="single-comment-box">
                                    <ul>
                                        @foreach ($apage as $item)
                                        <li>
                                            <div class="text-box">
                                                <h3>{{$item->article_title}} </h3>
                                                <p>
                                                    {{$item->article_abstract}}
                                                </p>
                                                <div class=" clearfix">
                                                    <span class="label label-default">创建时间：{{$item->created_at }}</span>
                                                    <div class="from-group" style="float: right;">
                                                        <a href="{{Route('admin.Article.edit',$item->article_id)}}" title="编辑" class="btn btn-default btn-circle waves-effect waves-circle waves-float"> <i class="material-icons">edit</i> </a>
                                                        <a href="{{Route('admin.Article.delete',$item->article_id)}}" title="删除" class="btn btn-default btn-circle waves-effect waves-circle waves-float"> <i class="material-icons">delete</i> </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        <hr />
                                        @endforeach
                                    </ul>
                                </div>
                            </div>
                            <nav>
                                {{ $apage->links() }}
                            </nav>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

@endsection

@push('scripts')
<script src="/assets/plugins/jquery-datatable/jquery.dataTables.js"
<script >
    $('.js-basic-example').DataTable();
    </script>
    @endpush